<!--
 * @Author: wangming
 * @Date: 2021-04-01 14:02:25
 * @LastEditors: wangming
 * @LastEditTime: 2022-03-25 10:57:33
 * @Description: file content
-->
<template>
  <el-form-item label="关联搜索组件">
    <el-select
      v-model="value.__config.relationSearchCom"
      clearable
      placeholder="请选择"
      style="width: 100%"
    >
      <el-option
        v-for="item in relationSearchComList"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      >
      </el-option>
    </el-select>
  </el-form-item>
</template>

<script>
import { mapGetters } from "vuex";
import basicmixins from "./basicmixins";
import { transformTreeFormRule } from "@/utils/common.js";
export default {
  mixins: [basicmixins],
  computed: {
    ...mapGetters(["getModelTreeList"]),
    relationSearchComList() {
      return transformTreeFormRule(
        this.getModelTreeList,
        (item) => {
          return (
            item.tagName == "hlSearch" &&
            item.__config.modelCode == this.value.__config.modelCode
          );
        },
        (item) => {
          return { label: item.name + "-" + item.key, value: item.key };
        }
      );
    },
  },
  data() {
    return {};
  },
  methods: {},
};
</script>

<style lang="scss" scoped></style>
